import 'dart:io';

import 'package:flutter/material.dart';

void main() {
  runApp(new InputChipPlugin());
}

/*
 * 初始化页
 InputChip 类似一个集合体<br/>
 * 需要传入的键：<br/>
 * 传入的值类型： <br/>
 * 传入的值含义：<br/>
 * 是否必传 ：
 */
class InputChipPlugin extends StatefulWidget {
  State<StatefulWidget> createState() {
    return new InputChipPluginState();
  }
}

/*
 * 页面功能 <br/>
 */
class InputChipPluginState extends State<StatefulWidget> {
  List<String> _selected = [];
  List<String> _tags = [
    'Apple',
    'Banana',
    'Lemon',
  ];
  String _action = 'Nothings';

  String _choice = 'Lemon';

  void initState() {
    super.initState();
  }

  Widget build(BuildContext context) {
    AppBar appBar = AppBar(
      leading: new IconButton(
        icon: new Icon(Icons.arrow_back),
        onPressed: () {},
      ),
      title: new Text('FlutterDesign'),
      centerTitle: true,
      actions: <Widget>[
        new Container(width: 0, height: 0),
        new Container(width: 0, height: 0),
      ],
      backgroundColor: Colors.blue,
    );

    return MaterialApp(
      home: new Scaffold(
        appBar: appBar,
        body: new Builder(builder: (BuildContext context) {
          return Wrap(
            spacing: 8.0,
            children: _tags.map((tag) {
              return InputChip(
                  label: Text("Chip的测试"),
                  disabledColor: Colors.green,
                  onSelected: (val) => {},
                  selected: true,
                  pressElevation: 20.0,
                  avatar: Icon(Icons.people),
                  deleteIcon:  Icon(Icons.add),
                  deleteButtonTooltipMessage: "deleteButtonTooltipMessage",
                  onDeleted: () {
                    print("delete success");
                  });
            }).toList(),
          );
        }),
        backgroundColor: Colors.white,
        bottomNavigationBar: null,
      ),
    );
  }
}
